package main

import (
	"daas/api"
	"embed"
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"github.com/jtyoui/gam"
)

//go:embed api click.html go.mod
var fs embed.FS

func main() {
	g := gin.Default()
	g.Use(cors.Default())
	g.LoadHTMLFiles("click.html")
	route := gam.NewGinRouter(g.Group("/api"), &fs)
	route.AutoRouter(&api.Qrcode{}, &api.Record{}, &api.Manage{}, &api.List{}, &api.Data{})
	err := g.Run("0.0.0.0:24154")
	if err != nil {
		return
	}
}
